package qotwReader.question;

import java.io.*;
import java.net.*;

import net.htmlparser.jericho.*;

public class QuestionHTML
{
    final private URL questionURL;
    final private Source questionSource;
    
    public QuestionHTML(URL questionURL) throws IOException
    {
        this.questionURL = questionURL;
        this.questionSource = downloadQuestionHTML();
    }
    
    private Source downloadQuestionHTML() throws IOException
    {
        Source downloadedSource = new Source(questionURL);
        // Calling this method can greatly improve performance if most or all of the tags in the document need to be parsed.
        downloadedSource.fullSequentialParse();
        
        return downloadedSource;
    }
    
    public Source getQuestionSource() { return this.questionSource; }
}
